﻿@using SharedRes = ViewRes.SharedStrings;

<div class="form-horizontal well well-transparent" data-bind="visible: true" style="display: none;">
	
	<div class="control-group">
		<div class="control-label">@ViewRes.Search.IndexStrings.ArtistType</div>
		<div class="controls">
			@ArtistHelpers.ArtistTypesDropdownKnockout("artistType")
		</div>
	</div>

	<div class="control-group">
		<div class="control-label">@SharedRes.Tag</div>
		<div class="controls" data-bind="with: tagFilters">
			@{ Html.RenderPartial("Partials/_TagFilters"); }
			<div>
				<input type="text" class="input-large" data-bind="tagAutoComplete: addTag" placeholder="@ViewRes.SharedStrings.Search" />
			</div>
		</div>
	</div>
	
</div>

<div data-bind="css: { loading: loading }, visible: true" style="display: none;">

	<div data-bind="with: paging" class="dropdown pull-right">
		@KnockoutHelpers.EntryCount()
	</div>

	<div data-bind="with: paging">
		@KnockoutHelpers.ServerSidePaging()
	</div>

	<table class="table table-striped" data-bind="css: { loading: loading }">
		<thead>
			<tr>
				<th colspan="2">
					@ViewRes.SharedStrings.ArtistName
				</th>
			</tr>
		</thead>
		<tbody data-bind="foreach: page">
			<tr data-bind="with: artist">
				<td style="width: 80px">
					<a data-bind="visible: $data.mainPicture && mainPicture.urlTinyThumb, attr: { href: vdb.utils.EntryUrlMapper.details('Artist', id), title: $data.additionalNames }" href="#" class="coverPicThumb">
						<img data-bind="attr: { src: ($data.mainPicture ? mainPicture.urlTinyThumb : '') }" title="Cover picture" class="coverPicThumb img-rounded" />
					</a>
				</td>
				<td>
					<a data-bind="text: name, attr: { href: vdb.utils.EntryUrlMapper.details('Artist', id) }" href="#"></a>
					&nbsp;
					<span data-bind="artistTypeLabel: artistType"></span>
					@KnockoutHelpers.DraftIcon("status")
					<br />
					<span data-bind="visible: $data.additionalNames">
						<small class="extraInfo" data-bind="text: $data.additionalNames"></small><br />						
					</span>
					<small class="extraInfo" data-bind="text: $parents[1].resources().artistTypeNames[$data.artistType]"></small>
				</td>
			</tr>
		</tbody>
	</table>

	<div data-bind="with: paging">
		@KnockoutHelpers.ServerSidePaging()
	</div>

</div>

